<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "gky_we_welcome".
 *
 * @property integer $id
 * @property string $title
 * @property string $description
 * @property string $picUrl
 * @property string $jumpUrl
 * @property string $createtime
 * @property string $weoid
 * @property integer $isSet
 *
 * @property GkyWeAccount $weixin
 */
class GkyWeWelcome extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'gky_we_welcome';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['createtime'], 'safe'],
            [['isSet'], 'integer'],
            [['title', 'description', 'picUrl', 'jumpUrl','weoid'], 'string', 'max' => 255]
        ];
    }

    public function getWeixin(){

        return $this->hasOne(GkyWeAccount::className(),['weoid'=>'weoid']);
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'weixin.wename' => '公众号',
            'title' => '标题',
            'description' => '描述',
            'picUrl' => '图片地址',
            'jumpUrl' => '跳转路径',
            'createtime' => '创建时间',
            'weoid' => 'Weoid',
            'isSet' => '设置状态',
        ];
    }
}
